package com.simpleframe.validator.validators;

import java.util.HashMap;
import java.util.Map;

import com.simpleframe.validator.FieldValidator;

public class EmailValidator extends FieldValidator {
	
	public EmailValidator(String mail){
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("mail", mail);
		setParams(map);
	}
	
	@Override
	public String getMessage() {
		return "只能输入有效的电子邮件地址, 例如a@b.com";
	}
	
	@Override
	public String getRegEx() {
		return "\\w{1,}[@][\\w\\-]{1,}([.]([\\w\\-]{1,})){1,3}$";
	}
}
